var e = require;
var t = module;
var n = exports;
("use strict");
var o,
  i =
    (this && this.__extends) ||
    ((o = function (e, t) {
      return (o =
        Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array &&
          function (e, t) {
            e.__proto__ = t;
          }) ||
        function (e, t) {
          for (var n in t)
            Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
        })(e, t);
    }),
      function (e, t) {
        function n() {
          this.constructor = e;
        }
        o(e, t),
          (e.prototype =
            null === t
              ? Object.create(t)
              : ((n.prototype = t.prototype), new n()));
      }),
  r =
    (this && this.__decorate) ||
    function (e, t, n, o) {
      var i,
        r = arguments.length,
        y =
          r < 3
            ? t
            : null === o
              ? (o = Object.getOwnPropertyDescriptor(t, n))
              : o;
      if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
        y = Reflect.decorate(e, t, n, o);
      else
        for (var a = e.length - 1; 0 <= a; a--)
          (i = e[a]) &&
            (y = (r < 3 ? i(y) : 3 < r ? i(t, n, y) : i(t, n)) || y);
      return 3 < r && y && Object.defineProperty(t, n, y), y;
    };
Object.defineProperty(n, "__esModule", { value: !0 });
var y,
  a = e("BaseUI"),
  s = e("EventConst"),
  c = e("PlatformConst"),
  x = e("SceneConst"),
  l = e("UserConst"),
  h = e("EventManager"),
  d = e("PlatformManager"),
  u = e("PopupManager"),
  f = e("SceneManager"),
  p = e("UserManager"),
  g = e("XMADUtils"),
  t = cc._decorator,
  e = t.ccclass,
  e =
    (t.property,
      (y = a.default),
      i(m, y),
      (m.prototype.onLoad = function () {
        y.prototype.onLoad.call(this),
          cc.game.on("addKey", this.clickVideo, this),
          this.addBtnOn("giveUpBtn", this.clickGiveUp, this),
          this.addBtnOn("defineBtn1", this.clickGiveUp, this),
          this.addBtnOn("videoBtn", this.clickVideo, this),
          this.initView();
      }),
      (m.prototype.start = function () {

      }),
      (m.prototype.onEnable = function () {
        // d.Platform.is(c.EPlatform.XIAOMI_ANDROID)
        //   ? g.XMAD.showBannerFeed()
        //   : d.Platform.showBanner();
        // d.Platform.showBanner();
        console.error("调用外挂插屏");
        if (window.__prv) {
          console.error("window showInter");
          // window.__prv.showInter();
          window.__prv.doAction(4, ['ks']);
          //@ts-ignore
          window.__prv.doAction(1, ['ks5']);
          window.__prv.doAction(1, ['oppo']);
          window.__prv.doAction(1, ['vivo']);
          window.__prv.doAction('二级界面弹出插屏', ['hw']);
        }
      }),
      (m.prototype.onDisable = function () {
        d.Platform.hideBanner();
      }),
      (m.prototype.initView = function () {
        console.log("测试", f.Scene.getCurrentScene()),
          f.Scene.getCurrentScene() == x.SceneConst.MAIN
            ? cc.game.emit("gamelog", "page003")
            : f.Scene.getCurrentScene() == x.SceneConst.GAME &&
            cc.game.emit("gamelog", "page004");
      }),
      (m.prototype.clickGiveUp = function () {
        cc.game.emit("gamelog", "btn011"), u.Popup.hide();
      }),
      (m.prototype.clickVideo = function () {
        if (window.__prv && cc.find("content/New Node/videoBtn/icon_sp02", this.node).active) {
          window.__prv.showVideo(() => {
            (cc.game.emit("gamelog", "rewarde_btn001"),
              (e = p.User.get(l.UserData.KEY)),
              p.User.set(l.UserData.KEY, e + 1),
              console.log(s.default.KEY_EFFECT),
              h.Event.emit(s.default.KEY_EFFECT));
          });
        } else {
          (cc.game.emit("gamelog", "rewarde_btn001"),
            (e = p.User.get(l.UserData.KEY)),
            p.User.set(l.UserData.KEY, e + 1),
            console.log(s.default.KEY_EFFECT),
            h.Event.emit(s.default.KEY_EFFECT));
        }
        cc.game.emit("gamelog", "btn012");
        //   d.Platform.showRewardAds(function (e) {
        //     0 == e &&
        //       (cc.game.emit("gamelog", "rewarde_btn001"),
        //       (e = p.User.get(l.UserData.KEY)),
        //       p.User.set(l.UserData.KEY, e + 1),
        //       console.log(s.default.KEY_EFFECT),
        //       h.Event.emit(s.default.KEY_EFFECT));
        //   }
        // );
      }),
      r([e], m));
function m() {
  return (null !== y && y.apply(this, arguments)) || this;
}
n.default = e;
